<template>
  <view class="container">
    <button type="primary" @click="navigateTo" class="uni-w-100">
      navigateTo
    </button>
    <button type="primary" @click="redirectTo" class="uni-w-100">
      redirectTo
    </button>
  </view>
</template>

<script>
  export default {
    name: "navigate",
    data() {
      return {};
    },
    methods: {
      navigateTo() {
        uni.navigateTo({
          url: "/pages/comp/navigator/navigate/navigate",
        });
      },
      redirectTo() {
        uni.redirectTo({
          url: "/pages/comp/navigator/navigate/navigate",
        });
      },
    },
    onUnload() {
      console.log("page unload");
    },
  };
</script>

<style>
  .uni-w-100 {
    width: 400rpx;
    margin: 20rpx auto;
  }
</style>
